﻿
Partial Class pruebas_reporte
    Inherits System.Web.UI.Page
    Dim sSQL, campos As String


    Protected Sub pruebas_reporte_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Response.Clear()
        Response.ContentType = "application/vnd.ms-excel"
        campos = Request.QueryString("campos")
        'lblSQL.Text = "Select " + campos + " from animal where hierro='SFC'"
        'lblSQL.Visible = False
        sSQL = "Select " + campos + " from animal where hierro='SFC'"
        Try
            Dim sdsAnimales As New SqlDataSource
            Dim sConectionString As String
            ' AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.GanaderiaConnectionString.ConnectionString
            sConectionString = ConfigurationManager.ConnectionStrings.Item("GanaderiaConnectionString").ToString
            sdsAnimales.ConnectionString = ConfigurationManager.ConnectionStrings.Item("GanaderiaConnectionString").ToString
            sdsAnimales.SelectCommand = sSQL
            sdsAnimales.DataBind()
            reporte.DataSource = sdsAnimales
            reporte.DataBind()


        Catch ex As Exception
            '   lblException.Text = e.ToString()

        End Try

    End Sub

   
End Class
